/********************************************/
  // Creation History
  // --------------------------------------------------------------
  //	Company:			HTHK
  //	NAME:				GroupProcess.java
  //    Title   :			Reflect the Staff Project Data Table
  //	FUNCTION:
  //	BY:				Poly Li
  //	DATE:				14/01/2004
  // --------------------------------------------------------------
/*********************************************/
// Copyright (c) 2002 HTHK

package tss.group;

import com.ffpc.sql.*;

import java.sql.*;
import java.util.Vector;

/**
 * A Class class.
 * <P>
 * @author HTHK
 */
public class GroupProcess
{
    public static GroupBean createBean()
    {
        return new Group();
    }

    public static  int insert(Connection con, GroupBean groupBean)
      throws DataException
    {
        Group group = (Group)groupBean;
        group.setConnection(con);
        return group.insert();
    }

    public static int update(Connection con, GroupBean groupBean)
      throws DataException
    {
        Group group = (Group)groupBean;
        group.setConnection(con);
        return group.update();
    }

    public static int delete(Connection con, GroupBean groupBean)
      throws DataException
    {
        Group group = (Group)groupBean;
        group.setConnection(con);
        return group.delete();
    }

    public static GroupBean[] find(Connection con, GroupBean groupBean)
      throws DataException
    {
        Group group = (Group)groupBean;
        BaseSqlCommand buc = new BaseSqlCommand(con);
        Vector rows = buc.find(group);
        GroupBean[] beans = new Group[rows.size()];
        for (int i=0;i<rows.size();i++)
        {
            Group bean = new Group();
            bean.setColumns((Column[])rows.get(i));
            beans[i] = bean;
        }
        return beans;
    }
}


